import Vue from 'vue';
//element
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import App from './App.vue';

import axios from 'axios'
import qs from 'qs' 
import router from './router.js' 
import tool from './tool.js' 

//设置axios为form-data
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.transformRequest = [function (data) {
    let ret = ''
    for (let it in data) {
      ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
    }
    return ret
}]

Vue.use(ElementUI)
Vue.use(tool)
Vue.prototype.$axios = axios 
Vue.prototype.qs = qs 


let app=new Vue({
  el: '#app',
  router,
  render: h => h(App)
}).$mount('#app')

